import java.util.HashMap;

public class Memory extends Constants {

	public static HashMap<Integer, Integer> memoryValues = new HashMap<Integer, Integer>();
	public static int memOutput;

	public static void memoryOperation(boolean MemWrite, boolean MemRead,
			boolean MemtoReg, int ALUResult, int ReadData2) {

		if (MemtoReg == false) {
			memOutput = ALUResult;
		} else if (JAL) {
			memOutput = PC.currentAddress + 4;
		} else if (MemRead) {
			memOutput = memoryValues.get(ALUResult);
		} else if (MemWrite) {
			memoryValues.put(ALUResult, ReadData2);
		}

	}

}
